<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>书籍管理——书籍列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <style type="text/css">
        *{
            padding: 0;
            margin: 0;
        }
        /*.search{
            width: 30%;
            margin: 100px auto;
            display: flex;
            !*border: 1px solid red;*!
        }*/
        .search input{
            float: right;//左浮动
        flex: 4;
            height: 30px;
            outline: none;
            border: 1px solid red;
            box-sizing: border-box;
            padding-left: 10px;
        }
        .search button{
            float: right;
            flex: 1;
            height: 30px;
            background-color: red;
            color: white;
            border-style: none;
            outline: none;
        }
        .search button i{
            font-style: normal;
        }
        .search button:hover{
            font-size: 16px;
        }
    </style>
</head>
<body>
<div class="container">

    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>书籍列表 —— 显示所有书籍</small>
                </h1>
            </div>
        </div>

    </div>

    <div class="row">
        <div class="col-md-4 column">
            <a class="btn btn-primary" th:href="@{/book/add}">新增</a>
            <a class="btn btn-primary" th:href="@{/book/bookList}">显示全部书籍</a>
        </div>
        <div class="search" style="text-align: center">
            <form th:action="@{/book/queryBook}" method="get">
                <input type="text" name="bookName" placeholder="请输入书籍名称">
                <input type="submit" value="搜索">
            </form>
        </div>
    </div>


    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>书籍编号</th>
                    <th>书籍名字</th>
                    <th>书籍数量</th>
                    <th>书籍详情</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="book:${book}">
                    <td th:text="${book.getBookID()}"></td>
                    <td th:text="${book.getBookName()}"></td>
                    <td th:text="${book.getBookCounts()}"></td>
                    <td th:text="${book.getDetail()}"></td>
                    <td>
                        <a th:href="@{/book/update(id=${book.getBookID()})}">更改</a> |
                        <a th:href="@{/book/delete(id=${book.getBookID()})}" onclick="return window.confirm('确定要删除吗？');">删除</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>
</html>